﻿<%@ Page MasterPageFile="~/Site.Master" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Omu.AwesomeWebFormsDemo._Default" %>
<%-- the "o" tag is registered in web.config --%>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 <div class="result"> 
 <asp:Literal runat="server" ID="Result"></asp:Literal>
 </div>
    <h2>
            Lookup with pagination (more results button)
        </h2>
        
        <o:Lookup runat="server" ID="FruitLookup" GetUrl="~/svc/aja.svc/FruitGet" SearchUrl='~/svc/aja.svc/FruitSearch' />
            
            <h2>
            MultiLookup with pagination (more results button)
        </h2>        
        <o:MultiLookup runat="server" ID="FruitsMultiLookup" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitSearch' SelectedUrl="~/svc/aja.svc/FruitSelected"
            FullScreen="True" Modal="false" ClearButton="true" />
         

 <h2>
            AjaxDropdown bound to another one by parentId</h2>
        <o:AjaxDropdown runat="server" ID="CategoryAjaxDropdown" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown> = 
        <%
            FruitAjaxDropdown.ParentId = CategoryAjaxDropdown.ClientID;
        %>
        <o:AjaxDropdown runat="server" ID="FruitAjaxDropdown" Url="~/svc/aja.svc/FruitsDropdown"></o:AjaxDropdown>
        
        <h2>AjaxDropdown bound to MultiLookup</h2>
        <o:MultiLookup runat="server" ID="CategoriesMultiLookup" GetMultipleUrl="~/svc/aja.svc/CategoryGetMultiple"
            SearchUrl='~/svc/aja.svc/CategorySearch' SelectedUrl="~/svc/aja.svc/CategorySelected"/><span style="vertical-align: top;" > = </span>            
            <%
            FruitsFromMultiLookupAjaxDropdown.ParentId = CategoriesMultiLookup.ClientID;
%>
            <o:AjaxDropdown runat="server" ID="FruitsFromMultiLookupAjaxDropdown" Url="~/svc/aja.svc/FruitsFromMultiDropdown"></o:AjaxDropdown>            
            
            <h2>
            AjaxDropdown bound to 2 dropdowns </h2>
        <o:AjaxDropdown runat="server" ID="Category1AjaxDropdown" Url="~/svc/aja.svc/CategoriesDropdown" >
        </o:AjaxDropdown> and 
        <o:AjaxDropdown runat="server" ID="Category2AjaxDropdown" Url="~/svc/aja.svc/CategoriesDropdown" >
        </o:AjaxDropdown>    =
            <%
            FruitsFrom2CategoriesAjaxDropdown.Data = new Dictionary<string, string>
                                {
                                    {"c1",Category1AjaxDropdown.ClientID},
                                    {"c2",Category2AjaxDropdown.ClientID}
                                };
%>
        <o:AjaxDropdown runat="server" ID="FruitsFrom2CategoriesAjaxDropdown" Url="~/svc/aja.svc/FruitsFrom2CatDropdown"></o:AjaxDropdown>
        
         <h2>
            AjaxRadioList bound to another one by parentId</h2>
        <o:AjaxRadioList runat="server" ID="CategoriesAjaxRadioList" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxRadioList> = 
        <%
            FruitsAjaxRadioList.ParentId = CategoriesAjaxRadioList.ClientID;
        %>
        <o:AjaxRadioList runat="server" ID="FruitsAjaxRadioList" Url="~/svc/aja.svc/FruitsList"></o:AjaxRadioList>
        
        
         <h2>
           AjaxCheckboxList bound to an AjaxCheckboxList and an AjaxDropdown </h2>
        <o:AjaxCheckboxList runat="server" ID="Cat1AjaxCheckboxList" Url="~/svc/aja.svc/CategoriesCheckboxList">
        </o:AjaxCheckboxList> and 
        <o:AjaxDropdown runat="server" ID="Cat2AjaxDropdown" Url="~/svc/aja.svc/CategoriesDropdown"/>=
            <%
            FruitsFrom2CatAjaxCheckboxList.Data = new Dictionary<string, string>
                                {
                                    {"c1",Cat1AjaxCheckboxList.ClientID},
                                    {"c2",Cat2AjaxDropdown.ClientID}
                                };
%>
        <o:AjaxCheckboxList runat="server" ID="FruitsFrom2CatAjaxCheckboxList" Url="~/svc/aja.svc/FruitsFrom2CatCheckboxList"></o:AjaxCheckboxList>        
        
        <h2>AjaxList bound to a textbox</h2>
        
        
        <asp:TextBox runat="server" ID="Name"></asp:TextBox>
    <input type="button" id="bsearch" value="search"/>
    <script type="text/javascript">
    function hi(o) {
        alert('hi the id is ' + o);
    }
    </script>
    <% 
        FruitsAjaxList.Buttons = new[]
                              {
                                  new AjaxListButton {Content = "hi", JsFunc = "hi"}
                              };
        FruitsAjaxList.Data = new Dictionary<string, string> { { "search", Name.ClientID } };
        FruitsAjaxList.SearchButton = "bsearch";
%>
    <o:AjaxList runat="server" ID="FruitsAjaxList" SearchUrl='~/svc/aja.svc/FruitSearch' />
    
    <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Show"/>
    <br/><br/><br/>
</asp:Content>